<?php
// $Id: results.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $
global $base_url,$language;
  $url = $base_url . '/' . drupal_get_path('module', 'service');
//echo_r($language);
echo "<pre>";print_r($items); echo"</pre>";
 // echo $nid->nid;
if($language->language=='ta'){
	$lang= '/ta';
}else{
 $lang='';
}
?>		
        <div class="view-header" id="viewmod_service_registration_<?php echo $language->language?>">
		<div class="inner_tab_content">
			<div class = "inner_li"><a class="view_head_nonsel" href="<?php echo $base_url.$lang?>/service/deptname"><?php echo t('Department wise')?></a></div>
		    <div class = "inner_li"><a class="view_head_nonsel" href="<?php echo $base_url.$lang?>/service/atoz"><?php echo t('Service wise')?></a></div>		
			<div class = "inner_li"><a class="view_head_nonsel" href="<?php echo $base_url.$lang?>/service/category"><?php echo t('Category wise')?></a></div>		
		    <div class = "inner_li"><a class="view_head_nonsel" href="<?php echo $base_url.$lang?>/service/search"><?php echo t('Search')?></a></div>
		</div>
		<?php  foreach($items as $row){?>
		<?php $dep = $row->field_src_dept['und'][0]['value'];
		my_db_change(1);
				$qury = db_query("select n.dept_name from depart_mst AS n where dep_id = '$dep'");
				foreach($qury  as $key){				
					$depname = $key->dept_name; 
				}
				my_db_change(0);
		?>
		<?php } ?>
	  <div class="result_inner">
		<div class="res_dept"><span><strong><?php echo t($depname)?></strong>
		<span onclick="window.history.go(-1); " style="cursor:pointer; float:right;padding-right:5px">
		<font color="#494949" font-weight:bold="" ;=""><?php echo t('Back')?></font></span>
		</span></div>

		<?php  $i=0; foreach($items as $row){?>
		<?php $cat = $row->field_src_cate['und'][0]['value'];
			  $orgnme= $row->field_src_org['und'][0]['value']; ?>
			  <?php 	
				my_db_change(1);
				$qury = db_query("select n.title from node AS n where nid = '$orgnme'");
				foreach($qury  as $key){				
					$orgname = $key->title; 
				}
				my_db_change(1);
				$query = db_query("select cate_name from category_mst where cate_id ='$cat'");
				foreach($query  as $key){
					$catname = $key->cate_name; 
				}
				my_db_change(0);
				$i++;
				?>
			  <div class="res_title_ch">
					<span class="left_column"><?php echo t('Organisation Name')?></span>
					<span class="middle_column"> : </span>
					<?php if($orgname){?>
					<span class="right_column"><?php echo t($orgname)?></span>
					<?php }else{?>
					<span class="right_column"> - </span>
					<?php }?>
					<div class="clr"></div>
				</div>
				<div class="res_title_ch">
					 <span class="left_column"><?php echo t('Category')?></span>
					 <span class="middle_column"> : </span>
					 <span class="right_column"><?php echo t($catname)?></span>
					 <div class="clr"></div>
				</div>
				
				<div class="res_title_ch">
					<span class="left_column"><?php echo t('Service Title')?></span>
					<span class="middle_column"> : </span>
					<span class="right_column"><?php echo t($row->title) ?></span>
					<div class="clr"></div>	
				</div>

				<div class="res_title_ch">
					<span class="left_column"><?php echo t('Description')?></span>
					<span class="middle_column"> : </span>
					<span class="right_column"><?php echo t($row->field_scr_desc['und'][0]['value']) ?> </span>
					<div class="clr"></div>	
					
				</div><div class="res_title_ch">
					<span class="left_column"><?php echo t('Url')?></span>
					<span class="middle_column"> : </span>
				<span class="right_column"><a ;="" onclick="return tnportal_ext_window('<?php echo $row->field_src_website['und'][0]['value']; ?>')" href="javascript:void(0);"><?php echo t($row->field_src_website['und'][0]['value']) ?>
					</a></span>
					<div class="clr"></div>
		</div>		
		<?php }?>
		<?php if($i == '0'){?>
			 <div class="no_record"><?php echo t('No Results Found')?> </div>';
	<?php	} ?>
	<div class="clr"></div>
</div>